home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / scheme / pcscheme / geneva / sources.exe / SAMPLES / PASCAL.S < prev    next >
Encoding:
Text File  |  1993-02-05  |  717 b   |  22 lines

  1. (define (pascal rows modulus)
  2.   (define ystep 2)
  3.   (define xstep 2)
  4.   (define xshift -1)
  5.   (define radius 1)
  6.   (define (put-list x y l)
  7.     (when (pair? l)
  8. ;      (set-color (remainder (car l) modulus))
  9. ;      (circle (cons x y) radius)
  10.       (let ((color (remainder (car l) modulus)))
  11.         (put-pixel (cons x y) color))
  12. ;        (put-pixel (cons x (1+ y)) color))
  13. ;        (put-pixel (cons (1+ x) y) color)
  14. ;        (put-pixel (cons (1+ x) (1+ y)) color))
  15.       (put-list (+ x xstep) y (cdr l))))
  16.   (define (inner rows x y l)
  17.     (put-list x y l)
  18.     (if (> rows 0)
  19.     (inner (- rows 1) (+ x xshift) (+ y ystep)
  20.            (map + (cons 0 l) (append l '(0))))))
  21.   (inner rows (quotient (car (get-max-xy)) 2) ystep '(1)))
  22.